//
//  Head.h
//  FMJY
//
//  Created by 汪高明 on 2017/5/27.
//  Copyright © 2017年 随心. All rights reserved.
//

#ifndef Head_h
#define Head_h

#import <MJExtension.h>
#import "UserModel.h"


#define UserInfoKey @"userInfo"


/**
 *  设置用户信息
 *
 *  @param m 用户对象
 */
#define setUserInfo(m) [[NSUserDefaults standardUserDefaults] setObject:[NSKeyedArchiver archivedDataWithRootObject:(m)] forKey:UserInfoKey];

/**
 *  获取用户信息
 *
 *  @return UserModel
 */
#define GetUserInfo [NSKeyedUnarchiver unarchiveObjectWithData:[[NSUserDefaults standardUserDefaults] objectForKey:UserInfoKey]]



/**
 获取用户登录Token

 @return LoginToken
 */
#define GetUserLoginToken [[NSKeyedUnarchiver unarchiveObjectWithData:[[NSUserDefaults standardUserDefaults] objectForKey:UserInfoKey]] loginToken]

/**
 *  删除用户信息.
 *
 */
#define DeleteUserInfo [[NSUserDefaults standardUserDefaults] removeObjectForKey:UserInfoKey]
#endif /* Head_h */

#define KRGBColor(r,g,b,p) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(p)]
